<cfcomponent output="false">
	
	<!--- --->
	
	<cffunction name="addMessage" access="public" output="true" returntype="void">
		<cfargument name="message" required="true" />
	
		<cfif not structKeyExists(session,"alerts")>
			<cfset session.alerts = [] />
		</cfif>
		
		<cfset arrayPrepend(session.alerts,arguments.message) />

	</cffunction>
	
	<!--- --->
	
	<cffunction name="getMessages" access="public" output="true" returntype="array">
	
		<cfset var local = {} />

		<cfif not structKeyExists(session,"alerts")>
			<cfset session.alerts = [] />
		</cfif>
		
		<cfset local.alerts = session.alerts />
		<cfset session.alerts = [] />
		
		<cfreturn local.alerts />

	</cffunction>
	
	<!--- --->
	
</cfcomponent>